import Vue from 'vue'
import VueRouter from 'vue-router'
import Echarts from "@/views/Echarts";
import AboutView from "@/views/AboutView";
import Login from "@/views/Login";
import Prouct from "@/views/Prouct";
import ProuctDetail from "@/views/ProuctDetail";
import MyCart from "@/views/MyCart";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/mycart',
    name: 'MyCart',
    component: MyCart
  },
  {
    path: '/echarts',
    name: 'Echarts',
    component: Echarts
  },
  {
    path: '/product',
    name: 'Prouct',
    component: Prouct
  },
  {
    path: '/product/detail/:id',
    name: 'ProuctDetail',
    component: ProuctDetail
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
